<?php

class Application_Model_RolesService
{
    private static $instance = null;
    
    public static function getInstance(){
        if (Application_Model_RolesService::$instance == null)
            Application_Model_RolesService::$instance = 
                new Application_Model_RolesService();
        
        return Application_Model_RolesService::$instance;
    }
    
    private $roles = array(
		'admin' => 'admin',
		'client' => 'client',
		'worker' => 'worker',
		'copywriter' => 'copywriter'
	);
	
	public function getRoles(){
		return $this->roles;
	}
    
    public function getRoleById($id){
        $roles = $this->roles;
        if (isset($roles[$id])){
            return $roles[$id];
        } else {
            return null;
        }
	}
}

